local skel = fk.CreateSkill {
  name = "lb_zero__mengyao_yurenxie",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable {
  ["lb_zero__mengyao_yurenxie"] = "渔人蟹",
  [":lb_zero__mengyao_yurenxie"] = "<b>锁定技</b>，获得此技能后，从技能库中移除此技能，直到你下个回合开始，你不能成为【杀】或【决斗】的目标。",

  ["@@lb_zero__mengyao_yurenxie"] = "渔人蟹",

  ["$lb_zero__mengyao_yurenxie1"] = "",
  ["$lb_zero__mengyao_yurenxie2"] = "",
}


skel:addEffect("prohibit", {
  is_prohibited = function(self, from, to, card)
    if to:hasSkill(skel.name) and to:getMark("@@"..skel.name) ~= 0 and card then
      return table.contains({"slash", "duel"}, card.trueName)
    end
  end,
})

skel:addEffect(fk.TurnStart, {
  can_refresh = function (self, event, target, player, data)
    return player == target and player:getMark("@@"..skel.name) ~= 0
  end,
  on_refresh = function (self, event, target, player, data)
    player.room:setPlayerMark(player, "@@"..skel.name, 0)
  end
})

skel:addAcquireEffect(function(self, player, is_start)
  local room = player.room
  room:setPlayerMark(player, "@@"..skel.name, 1)
  player.room:broadcastPlaySound("./packages/lb_kill_zero/audio/skill/mengyao_audio/yihai_" .. math.random(3, 4))
  local skills = player:getTableMark("lb_zero__mengyao_skills")
  for i, skill_list in ipairs(skills) do
    for j, skill in ipairs(skill_list) do
      if skill == skel.name then
        table.remove(skills[i], j)
        room:setPlayerMark(player, "lb_zero__mengyao_skills", skills)
        return
      end
    end
  end
end)

skel:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@@"..skel.name, 0)
end)

return skel
